package com.chb.docter.factory;

import com.chb.docter.feigns.DeptFeign;
import com.hos.entity.sys.Dept;
import com.hos.entity.sys.User;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author: 陈海彬
 * @date: Created in 2023/12/12 18:47
 * @description:
 * @modified By:
 * @version:
 */
@Component
@Slf4j
public class DeptFeignFallbackFactory implements FallbackFactory<DeptFeign> {


    @Override
    public DeptFeign create(Throwable throwable) {
        log.error(throwable.getMessage());
        return new DeptFeign() {
            @Override
            public Dept selectDeptByDeptId(Long deptId) {
                log.error(throwable.getMessage());
                log.error("科室服务出现错误");
                return null;
            }

            @Override
            public int updateDeptByDeptId(Long deptId) {
                log.error("根据科室id使挂号编号自增出现异常");
                return 0;
            }


        };
    }


}